﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Windows.Forms;
using System.ComponentModel;

namespace Submarines
{
    class Lang
    {
        
        public static void Language(Form f, Type t)
        {
            string _lang;

            if (Global._Language == "Русский")
                _lang = "ru";
            else if (Global._Language == "עברית")
                _lang = "he";
            else _lang = "en";
            foreach (Control c in f.Controls)
            {
               ComponentResourceManager resources = new ComponentResourceManager(t);
               resources.ApplyResources(c, c.Name, new CultureInfo(_lang));
            }
        }        
    }
}
